import App from '../App';

const example = r => require.ensure([], () => r(require('../page/example/example')), 'example');
const twoView = r => require.ensure([], () => r(require('../page/example/twoView')), 'twoView');

export default [{
  path: '/',
  component: App, //顶层路由，对应index.html
  children: [ //二级路由。对应App.vue
    //地址为空时跳转home页面
    {
      path: '',
      redirect: '/example'
    },
    {
      path: '/example',
      component: example
    },
    // 多级路由
    {
      path: '/twoView',
      component: twoView,
      children: [
        {
          path: '/',
          component: example
        },
        {
          path: 'example',
          component: example
        }
      ]
    }
  ]
}]
